// 自动生成模板OmsOrder
package biz

import (
	"time"

	"github.com/go-kratos/kratos/v2/log"
)

// omsOrder表 结构体  OmsOrder
type OmsOrder struct {
	Id                    *int       `json:"id" form:"id" gorm:"primarykey;comment:id;column:id;size:19;"`                                                    //id
	MemberId              *int       `json:"memberId" form:"memberId" gorm:"comment:member_id;column:member_id;size:19;"`                                     //member_id
	OrderSn               *string    `json:"orderSn" form:"orderSn" gorm:"comment:订单号;column:order_sn;"`                                                      //订单号
	CouponId              *int       `json:"couponId" form:"couponId" gorm:"comment:使用的优惠券;column:coupon_id;size:19;"`                                        //使用的优惠券
	CreateTime            *time.Time `json:"createTime" form:"createTime" gorm:"comment:create_time;column:create_time;"`                                     //create_time
	MemberUsername        *string    `json:"memberUsername" form:"memberUsername" gorm:"comment:用户名;column:member_username;size:200;"`                        //用户名
	TotalAmount           *float64   `json:"totalAmount" form:"totalAmount" gorm:"comment:订单总额;column:total_amount;size:18;"`                                 //订单总额
	PayAmount             *float64   `json:"payAmount" form:"payAmount" gorm:"comment:应付总额;column:pay_amount;size:18;"`                                       //应付总额
	FreightAmount         *float64   `json:"freightAmount" form:"freightAmount" gorm:"comment:运费金额;column:freight_amount;size:18;"`                           //运费金额
	PromotionAmount       *float64   `json:"promotionAmount" form:"promotionAmount" gorm:"comment:促销优化金额（促销价、满减、阶梯价）;column:promotion_amount;size:18;"`       //促销优化金额（促销价、满减、阶梯价）
	IntegrationAmount     *float64   `json:"integrationAmount" form:"integrationAmount" gorm:"comment:积分抵扣金额;column:integration_amount;size:18;"`             //积分抵扣金额
	CouponAmount          *float64   `json:"couponAmount" form:"couponAmount" gorm:"comment:优惠券抵扣金额;column:coupon_amount;size:18;"`                           //优惠券抵扣金额
	DiscountAmount        *float64   `json:"discountAmount" form:"discountAmount" gorm:"comment:后台调整订单使用的折扣金额;column:discount_amount;size:18;"`               //后台调整订单使用的折扣金额
	PayType               *bool      `json:"payType" form:"payType" gorm:"comment:支付方式【1->支付宝；2->微信；3->银联； 4->货到付款；】;column:pay_type;"`                       //支付方式【1->支付宝；2->微信；3->银联； 4->货到付款；】
	SourceType            *bool      `json:"sourceType" form:"sourceType" gorm:"comment:订单来源[0->PC订单；1->app订单];column:source_type;"`                          //订单来源[0->PC订单；1->app订单]
	Status                *bool      `json:"status" form:"status" gorm:"comment:订单状态【0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单】;column:status;"`             //订单状态【0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单】
	DeliveryCompany       *string    `json:"deliveryCompany" form:"deliveryCompany" gorm:"comment:物流公司(配送方式);column:delivery_company;size:64;"`               //物流公司(配送方式)
	DeliverySn            *string    `json:"deliverySn" form:"deliverySn" gorm:"comment:物流单号;column:delivery_sn;size:64;"`                                    //物流单号
	AutoConfirmDay        *int       `json:"autoConfirmDay" form:"autoConfirmDay" gorm:"comment:自动确认时间（天）;column:auto_confirm_day;size:10;"`                  //自动确认时间（天）
	Integration           *int       `json:"integration" form:"integration" gorm:"comment:可以获得的积分;column:integration;size:10;"`                               //可以获得的积分
	Growth                *int       `json:"growth" form:"growth" gorm:"comment:可以获得的成长值;column:growth;size:10;"`                                             //可以获得的成长值
	BillType              *bool      `json:"billType" form:"billType" gorm:"comment:发票类型[0->不开发票；1->电子发票；2->纸质发票];column:bill_type;"`                         //发票类型[0->不开发票；1->电子发票；2->纸质发票]
	BillHeader            *string    `json:"billHeader" form:"billHeader" gorm:"comment:发票抬头;column:bill_header;size:255;"`                                   //发票抬头
	BillContent           *string    `json:"billContent" form:"billContent" gorm:"comment:发票内容;column:bill_content;size:255;"`                                //发票内容
	BillReceiverPhone     *string    `json:"billReceiverPhone" form:"billReceiverPhone" gorm:"comment:收票人电话;column:bill_receiver_phone;size:32;"`             //收票人电话
	BillReceiverEmail     *string    `json:"billReceiverEmail" form:"billReceiverEmail" gorm:"comment:收票人邮箱;column:bill_receiver_email;size:64;"`             //收票人邮箱
	ReceiverName          *string    `json:"receiverName" form:"receiverName" gorm:"comment:收货人姓名;column:receiver_name;size:100;"`                            //收货人姓名
	ReceiverPhone         *string    `json:"receiverPhone" form:"receiverPhone" gorm:"comment:收货人电话;column:receiver_phone;size:32;"`                          //收货人电话
	ReceiverPostCode      *string    `json:"receiverPostCode" form:"receiverPostCode" gorm:"comment:收货人邮编;column:receiver_post_code;size:32;"`                //收货人邮编
	ReceiverProvince      *string    `json:"receiverProvince" form:"receiverProvince" gorm:"comment:省份/直辖市;column:receiver_province;size:32;"`                //省份/直辖市
	ReceiverCity          *string    `json:"receiverCity" form:"receiverCity" gorm:"comment:城市;column:receiver_city;size:32;"`                                //城市
	ReceiverRegion        *string    `json:"receiverRegion" form:"receiverRegion" gorm:"comment:区;column:receiver_region;size:32;"`                           //区
	ReceiverDetailAddress *string    `json:"receiverDetailAddress" form:"receiverDetailAddress" gorm:"comment:详细地址;column:receiver_detail_address;size:200;"` //详细地址
	Note                  *string    `json:"note" form:"note" gorm:"comment:订单备注;column:note;size:500;"`                                                      //订单备注
	ConfirmStatus         *bool      `json:"confirmStatus" form:"confirmStatus" gorm:"comment:确认收货状态[0->未确认；1->已确认];column:confirm_status;"`                  //确认收货状态[0->未确认；1->已确认]
	DeleteStatus          *bool      `json:"deleteStatus" form:"deleteStatus" gorm:"comment:删除状态【0->未删除；1->已删除】;column:delete_status;"`                       //删除状态【0->未删除；1->已删除】
	UseIntegration        *int       `json:"useIntegration" form:"useIntegration" gorm:"comment:下单时使用的积分;column:use_integration;size:10;"`                    //下单时使用的积分
	PaymentTime           *time.Time `json:"paymentTime" form:"paymentTime" gorm:"comment:支付时间;column:payment_time;"`                                         //支付时间
	DeliveryTime          *time.Time `json:"deliveryTime" form:"deliveryTime" gorm:"comment:发货时间;column:delivery_time;"`                                      //发货时间
	ReceiveTime           *time.Time `json:"receiveTime" form:"receiveTime" gorm:"comment:确认收货时间;column:receive_time;"`                                       //确认收货时间
	CommentTime           *time.Time `json:"commentTime" form:"commentTime" gorm:"comment:评价时间;column:comment_time;"`                                         //评价时间
	ModifyTime            *time.Time `json:"modifyTime" form:"modifyTime" gorm:"comment:修改时间;column:modify_time;"`                                            //修改时间
}

// TableName omsOrder表 OmsOrder自定义表名 oms_order
func (OmsOrder) TableName() string {
	return "oms_order"
}

type OmsOrderRepo interface {
}

type OmsOrderUsecase struct {
	repo OmsOrderRepo
	log  *log.Helper
}

func NewOmsOrderUsecase(repo GreeterRepo, logger log.Logger) *OmsOrderUsecase {
	return &OmsOrderUsecase{repo: repo, log: log.NewHelper(logger)}
}
